<%@ page contentType="text/html; charset=utf-8" %>
<%@ include file="/WEB-INF/jsp/com/include/declare.jspf" %>
<%@ include file="/WEB-INF/jsp/com/include/doctype.jspf" %>
<script type="text/javascript" src="/kr/common/js/pie/pie_ready.js"></script>
<script type="text/javascript" src="<c:url value='/common/js/jquery-1.7.1.js'/>"></script>
<script type="text/javascript" src="<c:url value='/common/js/jquery-ui-1.8.16.custom.min.js'/>"></script>
<script type="text/javascript" src="<c:url value='/common/js/jquery-popup.0.2.js'/>"></script>
<script type="text/javascript" src="<c:url value='/common/js/ajaxupload.js'/>"></script>
<script type="text/javascript" src="<c:url value='/common/js/Common.js'/>"></script>
<script type="text/javascript" src="/kr/common/js/pie/pie_ready.js"></script>
<script>
function quotDelUpDate(quotNo){

    $.post("<c:url value='/mpg/quotUpdate.do'/>",
            {
                'quotNo' : quotNo
            },
            function(data){
                var result={};
                var items = $(data).find("item");
                items.each(function(index,element){
                   var name = $(this).find("name").text();
                   var value = $(this).find("value").text();
                   result[name] = value;
                });

                  
                    location.reload();
                    
            }  
        );      
       
}

function quotDetailView(quotNo1){
    var quotNo = document.getElementById("quotNo");
    
    quotNo.value = quotNo1;
    
    var frm = document.mpgQuotListForm;
    frm.action="<c:url value='/mpg/quotDetailView.do'/>";
   frm.submit();    
    
    
}



</script>
</head>
<body>
<%@ include file="/WEB-INF/jsp/com/include/layerpopup.jspf" %>
<div id="wrap" class="non-subnavigation">
    <%@ include file="/WEB-INF/jsp/com/include/navi_utill_sub.jspf" %>
    <%@ include file="/WEB-INF/jsp/com/include/navi_header.jspf" %>
    <hr />

    <%@ include file="/WEB-INF/jsp/com/include/sub_header_global03.jspf" %>
    <hr />


	<div id="container">
		<div id="subtitle-area"><div class="subtitle-area-inner">
			<%@ include file="/WEB-INF/jsp/com/include/location.jspf" %>
		</div></div>
		<div id="article">
			<ul class="mypage-navigation">
                <li><a href="<c:url value="/mpg/summeryList.do"/>"><img src="/kr/images/global_menu/navi_mypage01_out.gif" alt="나의 요약정보" /></a></li>
                <li><a href="<c:url value="/mpg/pwdCheckView.do"/>"><img src="/kr/images/global_menu/navi_mypage02_out.gif" alt="회원 정보" /></a></li>
                <li><a href="<c:url value="/mpg/QuotList.do"/>"><img src="/kr/images/global_menu/navi_mypage03_over.gif" alt="최근 견적" /></a></li>
                <li><a href="<c:url value="/mpg/ctlgListPaging.do"/>"><img src="/kr/images/global_menu/navi_mypage04_out.gif" alt="카탈로그 신청 이력" /></a></li>
                <li><a href="<c:url value="/mpg/tdaListPaging.do"/>"><img src="/kr/images/global_menu/navi_mypage05_out.gif" alt="시승 신청 이력" /></a></li>
                <li><a href="<c:url value="/mpg/mpgEvntInfoView.do"/>"><img src="/kr/images/global_menu/navi_mypage06_out.gif" alt="이벤트 참여 이력" /></a></li>
                <li><a href="<c:url value="/mpg/QAListPaging.do"/>"><img src="/kr/images/global_menu/navi_mypage07_out.gif" alt="Q&amp;A" /></a></li>
			</ul>
			<h4 class="subsection"><img src="/kr/images/title/h4_global_menu03_03.gif" alt="최근견적" /></h4>
			<form name="mpgQuotListForm" id="mpgQuotListForm" onsubmit="return falsue" method="post">
            <input type="hidden" name="quotNo" id="quotNo" value="">
            <div class="modify-contents-wrap">
				<h5><img src="/kr/images/title/h5_global_menu03_03.gif" alt="최근 견적 LIST" /></h5>
				<p><img src="/kr/images/title/h5_global_menu03_03_desc.gif" alt="현대자동차 홈페이지에서 완성한 최근 3개월 동안의 견적  LIST 입니다." /></p>
				<div class="boardlist-wrap subsection02">
					<table summary="번호, 차종, 차량가격, 견적일자, 견적서, 삭제">
					<caption>최근견적목록</caption>
					<colgroup>
						<col width="8%" />
						<col />
						<col width="12%" />
						<col width="12%" />
						<col width="10%" />
						<col width="10%" />
					</colgroup>
					<thead>
					<tr>
						<th scope="col">NO</th>
						<th scope="col">차종</th>
						<th scope="col">차량가격</th>
						<th scope="col">견적일자</th>
						<th scope="col">견적서</th>
						<th scope="col">삭제</th>
					</tr>
					</thead>
					<tbody>
                    
                    <c:if test="${empty resultList }">
                        <tr>
                         <td colspan="6">견적 정보가 없습니다.</td>
                        </tr>
                    </c:if>       
                  <c:forEach var="result" items="${resultList}" varStatus="status">
  
					<tr>
						<td class="center">${result.rnum }</td>
						<td>
							<div class="estimation-info">
								<img src="<c:out value='${result.imagePath }'></c:out>" alt="차량이미지" class="car-thumb" />
								<p class="infomation">${result.carName} ${result.gradeName} / ${result.colorName }</p>
							</div> 
						</td>
						<td class="center">
							${result.carPrice }
							<a href="<c:url value="/pur/purCounselReqView.do"/>"><img src="/kr/images/common/button/btn_purchase_counsel04.gif" alt="구매상담신청" /></a>
						</td>
						<td class="center"><c:out value="${result.regDate }"/></td>
						<td class="center">
							<a href="javascript:quotDetailView('${result.quotNo }')"><img src="/kr/images/common/icon/icon_document.gif" alt="견적서" /></a>
						</td>
						<td class="center last">
							<a href="javascript:quotDelUpDate('${result.quotNo }')"><img src="/kr/images/common/button/btn_delete02.gif" alt="삭제" /></a>
                            
						</td>
					</tr>
			
                    </c:forEach>
					</tbody>
					</table>
				</div>
			</div>
            </form>
		</div>
	</div>
	<hr />
    <%@ include file="/WEB-INF/jsp/com/include/footer.jspf" %>